package test1224;

public class Test {
    public static void main(String[] args) {
        // 根据方法的调用需求实现方法
        // 判断数组中是否有质数？有返回true，没有返回false
        int[] arr = {4,10,1,4, 20};
        boolean b = m20(arr);
        System.out.println(b);
    }
    public static boolean m20(int[] arr){
        boolean yando = false;
        for (int a:arr){
            yando = m(a);
            if (yando){
                break;
            }
        }
        return yando;
    }
    public static boolean m(int a){
        boolean yando = false;
        if (a==2){
            yando = true;
        }
        for (int i = 2; i < a/2; i++) {
            if (a % i == 0){
                break;
            }else if(a % i != 0 && i == a/2){
                yando = true;
            }
        }
        return yando;
    }
}